package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qijian.maindata.domain.Bom;
import com.qijian.maindata.domain.query.BomQuery;
import com.qijian.maindata.domain.vo.BomReminderVo;
import com.qijian.maindata.domain.vo.BomVo;
import com.qijian.maindata.domain.vo.BomVo4App;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 生产BOMMapper接口
 *
 * @author qijian
 * @date 2021-09-01
 */
public interface BomMapper extends BaseMapper<Bom> {
    Page<BomVo> selectVo(Page<Bom> page, @Param(Constants.WRAPPER) Wrapper<BomQuery> queryWrapper);

    Page<BomVo4App> list4app(Page<Bom> page, @Param(Constants.WRAPPER) Wrapper<BomQuery> queryWrapper);

    Page<BomVo> selectVoForProject(Page<Bom> page, @Param(Constants.WRAPPER) Wrapper<BomQuery> queryWrapper);

    List<BomVo> selectVo(@Param(Constants.WRAPPER) QueryWrapper<BomQuery> queryWrapper);

    String maxVersion(String code);

    List<String> classify();

    @Update("update main_bom set is_del = 0 where bom_id = #{itemId}")
    void recoveryBom(Long itemId);

    BomVo selectBomAllLineProcessItems(@Param("bomId") Long bomId);

    List<BomReminderVo> getReminderRecords();


    Page<BomVo> selectVoForDESQSLKJ(Page<Bom> page, @Param(Constants.WRAPPER) Wrapper<BomQuery> queryWrapper, @Param("startTime") String startTime);

    int updateBomLine(@Param("ids") List<Long> projectIds);
}
